new Vue({
  el: "#app",
  data() {
    return {
      form: {
        page: 1,			//页数
        limit: 10,			//每页数据条数
        Warehouse_Name:"",
      },
      tableData: [{
        Warehouse_SerialNumber:"1",
        Warehouse_Name:"模拟仓库1",
        Warehouse_Address:"黑龙江省哈尔滨市香坊区xx小区xx单元",
        Warehouse_Type:"0",
        Enterprise_Name:"西货郎",
        Children:{
          warehouse_enterprise: [{
            Warehouse_Enterprise_SerialNumber: "",
            Warehouse_SerialNumber: '',
            Enterprise_SerialNumber: '',
            Applicable_Type:"0",
          }],
        }
      },{
        Warehouse_SerialNumber:"2",
        Warehouse_Name:"模拟仓库2",
        Warehouse_Address:"黑龙江省哈尔滨市香坊区xx小区xx单元",
        Warehouse_Type:"1",
        Enterprise_Name:"东货郎",
        Children:{
          warehouse_enterprise: [{
            Warehouse_Enterprise_SerialNumber: "",
            Warehouse_SerialNumber: '',
            Enterprise_SerialNumber: '',
            Applicable_Type:"0",
          }],
        }
      },{
        Warehouse_SerialNumber:"3",
        Warehouse_Name:"模拟仓库3",
        Warehouse_Address:"黑龙江省哈尔滨市香坊区xx小区xx单元",
        Warehouse_Type:"0",
        Enterprise_Name:"北货郎",
        Children:{
          warehouse_enterprise: [{
            Warehouse_Enterprise_SerialNumber: "",
            Warehouse_SerialNumber: '',
            Enterprise_SerialNumber: '',
            Applicable_Type:"1",
          }],
        }
      }], //表格数据
      total: 1,
    };
  },
  mounted() {
    this.getList(this.form)
  },
  methods: {
    getList(data){//查询所有的仓库数据
      let this_ = this
      // $.ajax({
      //   type: 'POST',
      //   url: DomainName + "/getInquiryAction?token="+$.cookie("token"),
      //   data,
      //   complete: function (XMLHttpRequest) {
      //     _this.loading = false
      //     if (XMLHttpRequest.getResponseHeader("REDIRECT") == "REDIRECT") {
      //       window.parent.document.location.href = "../../../" + XMLHttpRequest.getResponseHeader("CONTENTPATH");
      //     }
      //   },
      //   success: function (Result) {
      //     console.log(Result);
      //     _this.tableData = Result      //将获取的数据存到表格数据中
      //   },
      //   dataType: "json"
      // });
    },
    FindMore(Warehouse_SerialNumber){//查看对应仓库详情
      let this_ = this
      window.location.href = './Goods.html?Warehouse_SerialNumber=' + Warehouse_SerialNumber
      // $.ajax({
      //   type: 'POST',
      //   url: DomainName + "/getInquiryAction",
      //   data: {
      //     Data: "supplier_info",
      //     token: $.cookie("token")
      //   },
      //   complete: function (XMLHttpRequest) {
      //     _this.loading = false
      //     if (XMLHttpRequest.getResponseHeader("REDIRECT") == "REDIRECT") {
      //       window.parent.document.location.href = "../../../" + XMLHttpRequest.getResponseHeader("CONTENTPATH");
      //     }
      //   },
      //   success: function (Result) {
      //     console.log(Result);
      //     _this.tableData = Result      //将获取的数据存到表格数据中
      //   },
      //   dataType: "json"
      // });
    },
    //号码改变查询
    handleSizeChange(val) {
      this.form.page = 1;
      this.form.limit = val;
      this.getList(this.form)
    },
    //号码按键查询
    handleCurrentChange(val) {
      this.form.page = val;
      this.getList(this.form)
    },
    addEnterprise() {//去增加仓库页
      window.location.href = './Add.html'
    },
  },
});
